package qc.module.cms.mapper;

import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;
import qc.module.cms.dto.ledview.LedViewDto;
import qc.module.cms.entity.LedView;

import java.util.List;

/**
 * LedViewMapper
 *
 * @author QuCheng Tech
 * @since 2023/12/20
 */
@Mapper
public interface LedViewMapper {
    LedViewMapper MAPPER = Mappers.getMapper(LedViewMapper.class);

    //起止日期不通过Mapper转换，在Service进行判断处理
    @Mapping(target = "begintm", ignore = true)
    @Mapping(target = "endtm", ignore = true)
    LedView toEntity(LedViewDto dto);

    //起止日期不通过Mapper转换，在Service进行判断处理
    @Mapping(target = "begintm", ignore = true)
    @Mapping(target = "endtm", ignore = true)
    LedViewDto toDto(LedView en);

    List<LedViewDto> toDtoList(List<LedView> list);
}
